package com.xxx.string;

import java.nio.charset.StandardCharsets;
import java.time.chrono.MinguoChronology;

/**
 * @version v1.0
 * @Description:
 * @Author zhanzhongxin
 * @Date 2021/7/19 9:32
 * @Copyright 博为峰
 */
public class Encode {
    public static void main(String[] args) {
        char c1 = '你';
//        System.out.println(c1 + 0);

        String s1 = "你";//-28 -67 -96
        byte[] bytes = s1.getBytes(StandardCharsets.UTF_8);//编码
        for (int i = 0; i < bytes.length; i++) {
//            System.out.println(bytes[i]);
        }

        byte[] bytes1 = {-28, -67, -96};
        String s2 = new String(bytes1, StandardCharsets.UTF_8);//解码
        System.out.println(s2);


    }
}
